package com.example.demo2.task;

import com.example.demo2.dao.TestMapper;
import com.example.demo2.service.ICheckService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Slf4j
@Component
@RestController
@RequestMapping(value = "/test")
public class TestTask {

    @Autowired
    private ICheckService checkService;
    @Autowired
    private TestMapper testMapper;

    /**
     * http://127.0.0.1:8888/test/check
     */
    @RequestMapping(value = "/check")
//    @Scheduled(cron = "*/5 * * * * ?")
    public void check() {
        checkService.check();
    }


}
